package com.fjrcloud.controller;

import com.fjrcloud.entity.*;
import com.fjrcloud.exception.BusinessException;
import com.fjrcloud.service.HouseholdService;
import com.fjrcloud.service.TemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by shengjian.lin on 17-1-7.
 */
@Controller
@RequestMapping("household")
public class HtmlHouseholdController {

    @Autowired
    private TemplateService templateService;
    @Autowired
    private HouseholdService householdService;

    @RequestMapping("list")
    public String list(Model model) throws BusinessException {

        Page<HouseholdMaster> page = householdService.masters(null,null);

        model.addAttribute("masters",page.getContent());

        return "housing-master-manage";
    }
//    @RequestMapping("detail")
//    public String detail(Model model,Integer id){
//
//        model.addAttribute("master",householdService.getMaster(id));
//
//        return "archives-detail";
//    }
}
